﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Newtonsoft.Json.Linq;

namespace xbmc_json_async.Media
{
    public class TvShows : List<TvShow>
    {
        /// <summary>
        /// Loads from json object.
        /// </summary>
        /// <param name="jsonObject">The json object.</param>
        /// <returns></returns>
        public bool LoadFromJsonObject(JObject jsonObject)
        {
            try
            {
                if (jsonObject["tvshows"] != null)
                {
                    foreach (JObject item in (JArray)jsonObject["tvshows"])
                    {
                        base.Add(TvShow.FromJsonObject(item));
                    }

                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                return false;
            }

        }
    }
}
